Skip to content

improve: make desktop picker startup faster and quieter - #2263

Merged
richiemcilroy merged 3 commits into
mainfrom
improve/desktop-picker-startup
Sep 9, 2026
Merged

improve: make desktop picker startup faster and quieter#2263
richiemcilroy merged 3 commits into
mainfrom
improve/desktop-picker-startup

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Sep 9, 2026

Copy link
Copy Markdown
Member

Opening Cap with disconnected saved inputs triggered blocking microphone/camera dialogs. Opening the display/window picker also repeated native input setup, producing visible delays. Restore saved inputs quietly while preserving their selections, join matching in-flight setup, and reuse only matching idle feeds with recent frames/samples. GPUI startup now enumerates microphone names without opening every audio configuration; detailed lookup opens only the requested microphone.

Controlled local macOS measurements with the built-in camera and microphone selected:

Picker measurement Before After
Tauri first display picker 1,921 ms 955 ms
Tauri reopening median 815 ms 65 ms
GPUI first display picker 1,046 ms 679 ms
GPUI reopening median 28 ms 24 ms

All 24 measured openings reached readiness. An additional six-opening Tauri run with the unavailable Shure MV7+ and Logitech selections completed without blocking dialogs and retained both saved selections. Recording readiness, manual selection errors, stalled-feed recovery, and camera-only preview routing remain enforced. Debug-only UI timing hooks and an ignored native benchmark are documented in apps/desktop/scripts/desktop-picker-performance.md.

Validation: 79 frontend tests; targeted camera, microphone, requested-input, applied-microphone, GPUI discovery and camera-cache tests; scoped Rust checks; both native development builds; production frontend build; formatting and scoped Biome. Strict Tauri/shared-recording Clippy passed. GPUI Clippy on stable 1.98 reports existing errors in unchanged files; GPUI check/build and targeted tests passed.

The cold measurements are individual observations and reopening medians contain five samples. Windows hardware and packaged release behavior remain unverified.

Greptile Summary

This PR reduces desktop picker startup latency by quietly restoring saved inputs, joining matching in-flight setup, reusing healthy matching camera and microphone feeds, and avoiding unnecessary microphone configuration lookups. It also adds debug-only picker benchmarks and documents the measurement process.

  • Reuses matching feeds only when recent frames or samples confirm they remain healthy.
  • Preserves recording readiness and stalled-feed recovery behavior.
  • Limits GPUI startup microphone discovery to device names.
  • Fixes both prior review findings by removing the narrating comment and renaming the benchmark script to kebab-case.

Confidence Score: 5/5

The PR appears safe to merge; no new actionable issues or outstanding previous findings remain.

Both previous findings were manually resolved and their underlying issues are fixed in the current code: the narrating comment was removed, and the benchmark script was renamed with its include reference updated. The changes since the previous review introduce no additional behavioral or rule-compliance failures.

Important Files Changed

Filename Overview
apps/desktop/src-tauri/src/lib.rs Adds request coalescing and health-checked reuse for matching microphone and camera inputs.
crates/recording/src/feeds/camera.rs Tracks camera settings and recent frame delivery so only healthy matching feeds are reused.
crates/recording/src/feeds/microphone.rs Tracks samples by stream and exposes targeted microphone lookup and feed-health checks.
apps/desktop-gpui/src/devices.rs Avoids opening every microphone configuration during startup enumeration.
apps/desktop/src/routes/target-select-overlay.tsx Restores saved inputs quietly while retaining readiness gating before recording.
apps/desktop/src-tauri/src/picker-benchmark.js Renames the debug benchmark script to the required kebab-case filename.
apps/desktop/src/routes/(window-chrome)/new-main/index.tsx Removes the implementation-narrating comment identified during the previous review.

Reviews (2): Last reviewed commit: "chore: use kebab-case for picker benchma..." | Re-trigger Greptile

Comment thread apps/desktop/src/routes/(window-chrome)/new-main/index.tsx Outdated
Comment thread apps/desktop/src-tauri/src/picker-benchmark.js
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit 6354032 into main Sep 9, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant